package com.cy.sapling.admin.web;

import com.cy.sapling.admin.entity.AdminUser;
import com.cy.sapling.admin.service.AdminUserService;
//import com.cy.sapling.search.entity.Goods;
//import com.cy.sapling.search.service.GoodsService;
import com.cy.sapling.search.entity.Goods;
import com.cy.sapling.search.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/11/21.
 */
@RestController
@RequestMapping("test")
public class TestServiceWeb {

    @Autowired
    private AdminUserService adminUserService;

    @RequestMapping("getAdminUser/{id}")
    public AdminUser getAdminUser(@PathVariable Long id){
        return adminUserService.getAdminUser(id);
    }
    @RequestMapping("getAdminUserAllList")
    public List<AdminUser> getAdminUserAllList(){
        return adminUserService.getAllAdminUserList();
    }

    @Autowired
    private GoodsService goodsService;

    @RequestMapping("getGoodsById/{id}")
    public Goods getGoodsById(@PathVariable Long id) {
        return goodsService.goodsById(id);
    }

    @RequestMapping("list")
    public List<Goods> list() {
        return goodsService.getAllList();
    }
}
